<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow: hidden">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${Title}</title>
<link rel="shortcut icon" href="${res}favicon.ico" type="image/x-icon" />
 <!--Basic Styles-->
<link href="../../framework/css/font.css" rel="stylesheet" />
<link href="../../framework/miniui/themes/material/miniui.css" rel="stylesheet" />
<link href="../../framework/css/app.min.1.css" rel="stylesheet" type="text/css" />
<link href="../../framework/css/app.min.2.css" rel="stylesheet" type="text/css" />
<script src="../../framework/main.js" type="text/javascript"></script>
<script src="../../framework/main.js" type="text/javascript"></script>

<style type="text/css">
    html, body{
        margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
    } 
    .body-detail .search-area .btn{
    margin-left:0px !important
    }
   .body-detail .pull-right{
    	display:flex
    }
        
    </style>
</head>
<body class="body-detail">
	<script>
	Page.onLoad(function(){
		mini.get('datagrid1').load();	
	});
	function onActionRenderer(e) {
           var grid = e.sender;//分页信息
           var record = e.record;//对象信息
           var rowIndex = e.rowIndex;//索引
           var s = "";
          	s='<input type="button" id="'+e.record.Id+'"  onclick="edit();" value="详情" />';
          	s+='<input type="button"  onclick="del();" value="删除" />'
           return s;
       }
	function edit(e){
   		var row;
   		if(e){
   			row = e.record;
   		} else {
   			var $row = mini.get("datagrid1").getSelected();
   			if(!$row){
   				top.mini.showTips({content:'请先选择要编辑的行!',state:'info'});
   				return;
   			} else {
   				row = $row;
   			}
   		}		
   		window.location.href =  "${ctx}eao/setting/retroactionDialog.jhtml?Id=" + row.Id;
   	}
	function del(e){
   		var row;
   		if(e){
   			row = e.record;
   		} else {
   			var $row = mini.get("datagrid1").getSelected();
   			if(!$row){
   				top.mini.showTips({content:'请先选择要编辑的行!',state:'info'});
   				return;
   			} else {
   				row = $row;
   			}
   		}
   		top.mini.confirm("删除后用户将不显示该项目有关数据，确定要删除么", function(action) {
   			if (action == "ok") {	
   				var dc = {
   					Ids : row.Id
   				};
   				Server.sendRequest("EaoGrid.deleteOpinion", dc,
  						function(response) {
  							if (response.Status == 1) {
  								top.mini.showTips({
  									content : response.Message,
  									state : 'success'
  								});
  								mini.get('datagrid1').clearSelect();
  								mini.get('datagrid1').reload();
  							} else {
  								top.mini.warn(response.Message);
  							}
  						});
   			}
   		});
   	}
   	
	function OperatorAction(e){
		 var RealName = "";
		    var Tel = "";
		    if(e.record.RealName){
			   RealName = e.record.RealName
			}
			if(e.record.Tel){
				Tel="("+e.record.Tel+")";
			}
		return RealName+Tel;
	}
	
	function doSearch(){
		var dc = {
			SearchText:$V('SearchText'),
			StartTime:mini.get("StartTime").getFormValue(),
			EndTime:mini.get("EndTime").getFormValue(),
		}
		mini.get('datagrid1').load(dc) ;
		}
</script>
	<div class="mini-fit" style="padding:0 10px 10px 10px;">
	<div class="pull-right">
			<input class="mini-textbox" id="SearchText" type="text" width="275" emptyText="请输入一级机构账号、提交人账号或名字" />
			<input id="StartTime" class="mini-datepicker" value="" allowInput="false"  emptyText="提交时间起" format="yyyy-MM-dd"/>
			<input id="EndTime" class="mini-datepicker" value="" allowInput="false"  emptyText="提交时间止" format="yyyy-MM-dd"/>
			<button class="btn btn-default" id="Submitbutton" onClick="doSearch()"><i class="iconfont icon-search"></i></button>
		</div>
		<div id="datagrid1" class="mini-datagrid z-depth-1" style="width:100%;height:100%;" method="EaoGrid.allOpinions" idField="Id" multiSelect="true">
		    <div property="columns">
		       	<div type="indexcolumn"></div>
		       	<div field="CompanyMobile" width="6%">一级机构账号</div>
		       	<div field="FullName" width="9%">一级机构名称</div>
		       	<div field="Mobile" width="6%">提交人账号</div>
		        <div renderer="OperatorAction" headerAlign="center" align="center"  width="8%">提交人名字(联系方式)</div>
	            <div field="Content"  width="20%">反馈内容</div>
	            <div field="CreateTime" dateFormat="yyyy-MM-dd HH:mm:ss" allowSort="true"  width="8%">反馈时间</div>
	            <div renderer="onActionRenderer" width="7%">操作</div>
		    </div>
		</div>
	</div>
</body>
</html>